package com.domain;

import java.util.Scanner;

public class StudentBean {
    private int sId; //学生id
    private String sName; //学生姓名
    private int sAge; //学生年龄
    private String sSex; //学生性别
    private String sAddress; //学生住址
    private String sDate; //学生生日
    private int gradeId; //学生成绩单号

    public StudentBean() {
    }

    public StudentBean(int sId, String sName, int sAge, String sSex, String sAddress, String sDate, int gradeId) {
        this.sId = sId;
        this.sName = sName;
        this.sAge = sAge;
        this.sSex = sSex;
        this.sAddress = sAddress;
        this.sDate = sDate;
        this.gradeId = gradeId;
    }

    /**
     * 获取
     * @return sId
     */
    public int getSId() {
        return sId;
    }

    /**
     * 设置
     * @param sId
     */
    public void setSId(int sId) {
        this.sId = sId;
    }

    /**
     * 获取
     * @return sName
     */
    public String getSName() {
        return sName;
    }

    /**
     * 设置
     * @param sName
     */
    public void setSName(String sName) {
        this.sName = sName;
    }

    /**
     * 获取
     * @return sAge
     */
    public int getSAge() {
        return sAge;
    }

    /**
     * 设置
     * @param sAge
     */
    public void setSAge(int sAge) {
        Scanner sc = new Scanner(System.in);
        boolean flag = false;
        while (!flag) {
            if (sAge <1 || sAge > 100){
                System.out.println("学生年龄输入错误，请重新输入！");
                sAge = sc.nextInt();
            }else {
                flag = true;
            }
        }
        this.sAge = sAge;
    }

    /**
     * 获取
     * @return sSex
     */
    public String getSSex() {
        return sSex;
    }

    /**
     * 设置
     * @param sSex
     */
    public void setSSex(String sSex) {
        this.sSex = sSex;
    }

    /**
     * 获取
     * @return sAddress
     */
    public String getSAddress() {
        return sAddress;
    }

    /**
     * 设置
     * @param sAddress
     */
    public void setSAddress(String sAddress) {
        this.sAddress = sAddress;
    }

    /**
     * 获取
     * @return sDate
     */
    public String getSDate() {
        return sDate;
    }

    /**
     * 设置
     * @param sDate
     */
    public void setSDate(String sDate) {
        this.sDate = sDate;
    }

    /**
     * 获取
     * @return gradeId
     */
    public int getGradeId() {
        return gradeId;
    }

    /**
     * 设置
     * @param gradeId
     */
    public void setGradeId(int gradeId) {
        this.gradeId = gradeId;
    }

    public String toString() {
        return "StudentBean{sId = " + sId + ", sName = " + sName + ", sAge = " + sAge + ", sSex = " + sSex + ", sAddress = " + sAddress + ", sDate = " + sDate + ", gradeId = " + gradeId + "}";
    }
}